<!DOCTYPE html>
<html id="konga">
<head>
    <title>Konga</title>

    <base href="<%= typeof base_url != 'undefined' ? base_url : '' %>">

    <!-- Viewport mobile tag for sensible mobile support -->
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

    <!--
        Stylesheets and Preprocessors
        ==============================

        You can always bring in CSS files manually with `<link>` tags, or asynchronously
        using a solution like AMD (RequireJS).  Or, if you like, you can take advantage
        of Sails' conventional asset pipeline (boilerplate Gruntfile).

        By default, stylesheets from your `assets/styles` folder are included
        here automatically (between STYLES and STYLES END). Both CSS (.css) and LESS (.less)
        are supported. In production, your styles will be minified and concatenated into
        a single file.

        To customize any part of the built-in behavior, just edit `tasks/pipeline.js`.
        For example, here are a few things you could do:

            + Change the order of your CSS files
            + Import stylesheets from other directories
            + Use a different or additional preprocessor, like SASS, SCSS or Stylus
    -->

    <!--<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">-->

    <!--STYLES-->
    <link rel="stylesheet" href="bower_components/angular-loading-bar/build/loading-bar.css?r=0.14.6">
    <link rel="stylesheet" href="bower_components/angular-xeditable/dist/css/xeditable.css?r=0.14.6">
    <link rel="stylesheet" href="bower_components/angular-toastr/dist/angular-toastr.css?r=0.14.6">
    <link rel="stylesheet" href="bower_components/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.css?r=0.14.6">
    <link rel="stylesheet" href="bower_components/angular-spinkit/build/angular-spinkit.min.css?r=0.14.6">
    <link rel="stylesheet" href="bower_components/angular-chips/dist/main.css?r=0.14.6">
    <link rel="stylesheet" href="bower_components/angular-json-human/dist/angular-json-human.css?r=0.14.6">
    <link rel="stylesheet" href="bower_components/mdi/css/materialdesignicons.css?r=0.14.6">
    <link rel="stylesheet" href="styles/importer.css?r=0.14.6">
    <!--STYLES END-->
</head>

<body class="body">
<%- body %>
<!--
    Client-side Templates
    ========================

    HTML templates are important prerequisites of modern, rich client applications.
    To work their magic, frameworks like Backbone, Angular, Ember, and Knockout require
    that you load these templates client-side.

    By default, your Gruntfile is configured to automatically load and precompile
    client-side JST templates in your `assets/templates` folder, then
    include them here automatically (between TEMPLATES and TEMPLATES END).

    To customize this behavior to fit your needs, just edit `tasks/pipeline.js`.
    For example, here are a few things you could do:

        + Import templates from other directories
        + Use a different template engine (handlebars, jade, dust, etc.)
        + Internationalize your client-side templates using a server-side
          stringfile before they're served.
-->

<!--TEMPLATES-->

<!--TEMPLATES END-->


<!--

  Client-side Javascript
  ========================

  You can always bring in JS files manually with `script` tags, or asynchronously
  on the client using a solution like AMD (RequireJS).  Or, if you like, you can
  take advantage of Sails' conventional asset pipeline (boilerplate Gruntfile).

  By default, files in your `assets/js` folder are included here
  automatically (between SCRIPTS and SCRIPTS END).  Both JavaScript (.js) and
  CoffeeScript (.coffee) are supported. In production, your scripts will be minified
  and concatenated into a single file.

  To customize any part of the built-in behavior, just edit `tasks/pipeline.js`.
  For example, here are a few things you could do:

      + Change the order of your scripts
      + Import scripts from other directories
      + Use a different preprocessor, like TypeScript

-->

<% if (typeof loadScripts != 'undefined' && loadScripts ) {%>


<script src="js/dependencies/sails.io.js"></script>
<!--<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>-->

<!--SCRIPTS-->
<script src="bower_components/jquery/dist/jquery.js?r=0.14.6"></script>
<script src="bower_components/angular/angular.js?r=0.14.6"></script>
<script src="bower_components/angular-animate/angular-animate.js?r=0.14.6"></script>
<script src="bower_components/angular-loading-bar/build/loading-bar.js?r=0.14.6"></script>
<script src="bower_components/angular-ui-router/release/angular-ui-router.js?r=0.14.6"></script>
<script src="bower_components/angular-ui-utils/ui-utils.js?r=0.14.6"></script>
<script src="bower_components/moment/moment.js?r=0.14.6"></script>
<script src="bower_components/later/later.js?r=0.14.6"></script>
<script src="bower_components/prettycron/prettycron.js?r=0.14.6"></script>
<script src="bower_components/angular-bootstrap-show-errors/src/showErrors.js?r=0.14.6"></script>
<script src="bower_components/angular-sanitize/angular-sanitize.js?r=0.14.6"></script>
<script src="bower_components/angular-xeditable/dist/js/xeditable.js?r=0.14.6"></script>
<script src="bower_components/angular-toastr/dist/angular-toastr.tpls.js?r=0.14.6"></script>
<script src="bower_components/bootstrap/dist/js/bootstrap.js?r=0.14.6"></script>
<script src="bower_components/angularSails/dist/ngsails.io.js?r=0.14.6"></script>
<script src="bower_components/ngstorage/ngStorage.js?r=0.14.6"></script>
<script src="bower_components/bootswatch-dist/js/bootstrap.js?r=0.14.6"></script>
<script src="bower_components/angular-bootstrap/ui-bootstrap-tpls.js?r=0.14.6"></script>
<script src="bower_components/lodash/lodash.js?r=0.14.6"></script>
<script src="bower_components/bootstrap-switch/dist/js/bootstrap-switch.js?r=0.14.6"></script>
<script src="bower_components/angular-spinkit/build/angular-spinkit.js?r=0.14.6"></script>
<script src="bower_components/angular-chips/dist/angular-chips.js?r=0.14.6"></script>
<script src="bower_components/ng-file-upload/ng-file-upload.js?r=0.14.6"></script>
<script src="bower_components/angular-messages/angular-messages.js?r=0.14.6"></script>
<script src="bower_components/angular-utils-pagination/dirPagination.js?r=0.14.6"></script>
<script src="bower_components/chart.js/dist/Chart.js?r=0.14.6"></script>
<script src="bower_components/angular-resource/angular-resource.js?r=0.14.6"></script>
<script src="bower_components/angular-moment/angular-moment.js?r=0.14.6"></script>
<script src="bower_components/bootbox/bootbox.js?r=0.14.6"></script>
<script src="bower_components/ngBootbox/dist/ngBootbox.js?r=0.14.6"></script>
<script src="bower_components/angular-json-human/dist/angular-json-human.js?r=0.14.6"></script>
<script src="bower_components/angular-bootstrap-switch/dist/angular-bootstrap-switch.js?r=0.14.6"></script>
<script src="bower_components/angular-chart.js/dist/angular-chart.js?r=0.14.6"></script>
<script src="bower_components/angular-base64/angular-base64.js?r=0.14.6"></script>
<script src="js/app/apis/00_apis.js?r=0.14.6"></script>
<script src="js/app/apis/api-model.js?r=0.14.6"></script>
<script src="js/app/apis/apis-service.js?r=0.14.6"></script>
<script src="js/app/apis/controllers/add-api-modal-controller.js?r=0.14.6"></script>
<script src="js/app/apis/controllers/add-api-plugin-modal-controller.js?r=0.14.6"></script>
<script src="js/app/apis/controllers/api-controller.js?r=0.14.6"></script>
<script src="js/app/apis/controllers/api-details-controller.js?r=0.14.6"></script>
<script src="js/app/apis/controllers/api-health-checks-controller.js?r=0.14.6"></script>
<script src="js/app/apis/controllers/api-metrics-controller.js?r=0.14.6"></script>
<script src="js/app/apis/controllers/apis-controller.js?r=0.14.6"></script>
<script src="js/app/apis/views/api-hc-model.js?r=0.14.6"></script>
<script src="js/app/app.js?r=0.14.6"></script>
<script src="js/app/certificates/00_certificates.js?r=0.14.6"></script>
<script src="js/app/certificates/certificate-model.js?r=0.14.6"></script>
<script src="js/app/certificates/certificates-controller.js?r=0.14.6"></script>
<script src="js/app/certificates/snis-model.js?r=0.14.6"></script>
<script src="js/app/cluster/00_cluster.js?r=0.14.6"></script>
<script src="js/app/cluster/cluster-model.js?r=0.14.6"></script>
<script src="js/app/cluster/controllers/cluster-list-controller.js?r=0.14.6"></script>
<script src="js/app/connections/00_connections.js?r=0.14.6"></script>
<script src="js/app/connections/connections-controller.js?r=0.14.6"></script>
<script src="js/app/connections/create-connection-controller.js?r=0.14.6"></script>
<script src="js/app/connections/edit-connection-controller.js?r=0.14.6"></script>
<script src="js/app/connections/node-model.js?r=0.14.6"></script>
<script src="js/app/connections/update-user-node-controller.js?r=0.14.6"></script>
<script src="js/app/consumers/00_consumers.js?r=0.14.6"></script>
<script src="js/app/consumers/acl-model.js?r=0.14.6"></script>
<script src="js/app/consumers/apis/consumer-apis-controller.js?r=0.14.6"></script>
<script src="js/app/consumers/consumer-controller.js?r=0.14.6"></script>
<script src="js/app/consumers/consumer-model.js?r=0.14.6"></script>
<script src="js/app/consumers/consumer-service.js?r=0.14.6"></script>
<script src="js/app/consumers/consumers-controller.js?r=0.14.6"></script>
<script src="js/app/consumers/credentials/consumer-credentials-controller.js?r=0.14.6"></script>
<script src="js/app/consumers/credentials/create-hmac-auth-controller.js?r=0.14.6"></script>
<script src="js/app/consumers/credentials/create-jwt-controller.js?r=0.14.6"></script>
<script src="js/app/consumers/credentials/create-key-auth-controller.js?r=0.14.6"></script>
<script src="js/app/consumers/credentials/create-oauth2-controller.js?r=0.14.6"></script>
<script src="js/app/consumers/credentials/manage-basic-auth-controller.js?r=0.14.6"></script>
<script src="js/app/consumers/credentials/mass-assign-credentials-controller.js?r=0.14.6"></script>
<script src="js/app/consumers/details/consumer-details-controller.js?r=0.14.6"></script>
<script src="js/app/consumers/groups/consumer-groups-controller.js?r=0.14.6"></script>
<script src="js/app/consumers/groups/group.js?r=0.14.6"></script>
<script src="js/app/consumers/groups/manage-groups-modal-controllers.js?r=0.14.6"></script>
<script src="js/app/consumers/plugins/consumer-plugins-controller.js?r=0.14.6"></script>
<script src="js/app/consumers/routes/consumer-routes-controller.js?r=0.14.6"></script>
<script src="js/app/consumers/services/consumer-services-controller.js?r=0.14.6"></script>
<script src="js/app/core/auth/auth.js?r=0.14.6"></script>
<script src="js/app/core/auth/login/login.js?r=0.14.6"></script>
<script src="js/app/core/auth/services/00_services.js?r=0.14.6"></script>
<script src="js/app/core/auth/services/AuthService.js?r=0.14.6"></script>
<script src="js/app/core/auth/services/UserService.js?r=0.14.6"></script>
<script src="js/app/core/auth/signup/signup.js?r=0.14.6"></script>
<script src="js/app/core/components/components.js?r=0.14.6"></script>
<script src="js/app/core/components/FocusOn.js?r=0.14.6"></script>
<script src="js/app/core/constants/AccessLevels.js?r=0.14.6"></script>
<script src="js/app/core/constants/BackendConfig.js?r=0.14.6"></script>
<script src="js/app/core/core.js?r=0.14.6"></script>
<script src="js/app/core/dependencies/dependencies.js?r=0.14.6"></script>
<script src="js/app/core/directives/directives.js?r=0.14.6"></script>
<script src="js/app/core/directives/konga-loader.js?r=0.14.6"></script>
<script src="js/app/core/directives/ListSearch.js?r=0.14.6"></script>
<script src="js/app/core/directives/RawView.js?r=0.14.6"></script>
<script src="js/app/core/error/error.js?r=0.14.6"></script>
<script src="js/app/core/filters/filters.js?r=0.14.6"></script>
<script src="js/app/core/interceptors/00_interceptors.js?r=0.14.6"></script>
<script src="js/app/core/interceptors/AuthInterceptor.js?r=0.14.6"></script>
<script src="js/app/core/interceptors/CsrfInterceptor.js?r=0.14.6"></script>
<script src="js/app/core/interceptors/ErrorInterceptor.js?r=0.14.6"></script>
<script src="js/app/core/interceptors/HttpTimeoutInterceptor.js?r=0.14.6"></script>
<script src="js/app/core/interceptors/KongaIntercenptor.js?r=0.14.6"></script>
<script src="js/app/core/interceptors/TemplateCacheInterceptor.js?r=0.14.6"></script>
<script src="js/app/core/layout/00_layout.js?r=0.14.6"></script>
<script src="js/app/core/layout/01_layout-controllers.js?r=0.14.6"></script>
<script src="js/app/core/layout/02_layout-directives.js?r=0.14.6"></script>
<script src="js/app/core/layout/03_layout-services.js?r=0.14.6"></script>
<script src="js/app/core/libraries/libraries.js?r=0.14.6"></script>
<script src="js/app/core/libraries/LoDash.js?r=0.14.6"></script>
<script src="js/app/core/models/00_models.js?r=0.14.6"></script>
<script src="js/app/core/models/DataModel.js?r=0.14.6"></script>
<script src="js/app/core/plugins/angular-vertilize.js?r=0.14.6"></script>
<script src="js/app/core/plugins/jsonc.js?r=0.14.6"></script>
<script src="js/app/core/plugins/material.spinner.js?r=0.14.6"></script>
<script src="js/app/core/plugins/uiBreadcrumbs.js?r=0.14.6"></script>
<script src="js/app/core/services/00_services.js?r=0.14.6"></script>
<script src="js/app/core/services/DataService.js?r=0.14.6"></script>
<script src="js/app/core/services/DialogService.js?r=0.14.6"></script>
<script src="js/app/core/services/HttpStatusService.js?r=0.14.6"></script>
<script src="js/app/core/services/KongErrorService.js?r=0.14.6"></script>
<script src="js/app/core/services/KongPluginsService.js?r=0.14.6"></script>
<script src="js/app/core/services/ListConfigService.js?r=0.14.6"></script>
<script src="js/app/core/services/MessageService.js?r=0.14.6"></script>
<script src="js/app/core/services/NodesService.js?r=0.14.6"></script>
<script src="js/app/core/services/NotificationsService.js?r=0.14.6"></script>
<script src="js/app/core/services/Semver.js?r=0.14.6"></script>
<script src="js/app/core/services/SocketHelperService.js?r=0.14.6"></script>
<script src="js/app/core/services/SubscriptionsService.js?r=0.14.6"></script>
<script src="js/app/dashboard/01_dashboard.js?r=0.14.6"></script>
<script src="js/app/dashboard/02_dashboard-controller.js?r=0.14.6"></script>
<script src="js/app/healthchecks/00_healthchecks.js?r=0.14.6"></script>
<script src="js/app/healthchecks/api-hc-model.js?r=0.14.6"></script>
<script src="js/app/healthchecks/healthchecks-controller.js?r=0.14.6"></script>
<script src="js/app/info/00_info.js?r=0.14.6"></script>
<script src="js/app/info/01_info-controllers.js?r=0.14.6"></script>
<script src="js/app/info/02_info-service.js?r=0.14.6"></script>
<script src="js/app/netdata-connections/01_netdata_connection.js?r=0.14.6"></script>
<script src="js/app/netdata-connections/netdata-connection-model.js?r=0.14.6"></script>
<script src="js/app/plugins/00_plugins.js?r=0.14.6"></script>
<script src="js/app/plugins/add-plugin-controller.js?r=0.14.6"></script>
<script src="js/app/plugins/add-plugin-modal-controller.js?r=0.14.6"></script>
<script src="js/app/plugins/add-plugins-controller.js?r=0.14.6"></script>
<script src="js/app/plugins/api-plugins-controller.js?r=0.14.6"></script>
<script src="js/app/plugins/edit-plugin-controller.js?r=0.14.6"></script>
<script src="js/app/plugins/plugin-helper-service.js?r=0.14.6"></script>
<script src="js/app/plugins/plugin-model.js?r=0.14.6"></script>
<script src="js/app/plugins/plugins-controller.js?r=0.14.6"></script>
<script src="js/app/plugins/plugins-service.js?r=0.14.6"></script>
<script src="js/app/routes/00_routes.js?r=0.14.6"></script>
<script src="js/app/routes/controllers/add-route-modal-controller.js?r=0.14.6"></script>
<script src="js/app/routes/controllers/add-route-plugin-modal-controller.js?r=0.14.6"></script>
<script src="js/app/routes/controllers/route-consumers-controller.js?r=0.14.6"></script>
<script src="js/app/routes/controllers/route-controller.js?r=0.14.6"></script>
<script src="js/app/routes/controllers/route-details-controller.js?r=0.14.6"></script>
<script src="js/app/routes/controllers/route-health-checks-controller.js?r=0.14.6"></script>
<script src="js/app/routes/controllers/route-plugins-controller.js?r=0.14.6"></script>
<script src="js/app/routes/controllers/routes-controller.js?r=0.14.6"></script>
<script src="js/app/routes/routes-model.js?r=0.14.6"></script>
<script src="js/app/routes/routes-service.js?r=0.14.6"></script>
<script src="js/app/services/00_services.js?r=0.14.6"></script>
<script src="js/app/services/controllers/add-service-modal-controller.js?r=0.14.6"></script>
<script src="js/app/services/controllers/add-service-plugin-modal-controller.js?r=0.14.6"></script>
<script src="js/app/services/controllers/service-consumers-controller.js?r=0.14.6"></script>
<script src="js/app/services/controllers/service-controller.js?r=0.14.6"></script>
<script src="js/app/services/controllers/service-details-controller.js?r=0.14.6"></script>
<script src="js/app/services/controllers/service-health-checks-controller.js?r=0.14.6"></script>
<script src="js/app/services/controllers/service-plugins-controller.js?r=0.14.6"></script>
<script src="js/app/services/controllers/service-routes-controller.js?r=0.14.6"></script>
<script src="js/app/services/controllers/services-controller.js?r=0.14.6"></script>
<script src="js/app/services/service-model.js?r=0.14.6"></script>
<script src="js/app/services/services-service.js?r=0.14.6"></script>
<script src="js/app/services/views/service-hc-model.js?r=0.14.6"></script>
<script src="js/app/settings/01_settings.js?r=0.14.6"></script>
<script src="js/app/settings/email-transport-model.js?r=0.14.6"></script>
<script src="js/app/settings/settings-controller.js?r=0.14.6"></script>
<script src="js/app/settings/settings-model.js?r=0.14.6"></script>
<script src="js/app/settings/settings-service.js?r=0.14.6"></script>
<script src="js/app/snapshots/00_snapshots.js?r=0.14.6"></script>
<script src="js/app/snapshots/controllers/snapshot-controller.js?r=0.14.6"></script>
<script src="js/app/snapshots/controllers/snapshots-controller.js?r=0.14.6"></script>
<script src="js/app/snapshots/controllers/snapshots-list-controller.js?r=0.14.6"></script>
<script src="js/app/snapshots/controllers/snapshots-scheduled-controller.js?r=0.14.6"></script>
<script src="js/app/snapshots/snapshot-model.js?r=0.14.6"></script>
<script src="js/app/snapshots/snapshot-schedule-model.js?r=0.14.6"></script>
<script src="js/app/snapshots/snapshots-service.js?r=0.14.6"></script>
<script src="js/app/upstreams/01_upstreams.js?r=0.14.6"></script>
<script src="js/app/upstreams/add-upstream-modal-controller.js?r=0.14.6"></script>
<script src="js/app/upstreams/alerts/alerts-modal-controller.js?r=0.14.6"></script>
<script src="js/app/upstreams/alerts/edit-upstream-alerts-controller.js?r=0.14.6"></script>
<script src="js/app/upstreams/edit-upstream-controller.js?r=0.14.6"></script>
<script src="js/app/upstreams/edit-upstream-details-controller.js?r=0.14.6"></script>
<script src="js/app/upstreams/targets/edit-upstream-targets-controller.js?r=0.14.6"></script>
<script src="js/app/upstreams/update-upstream-modal-controller.js?r=0.14.6"></script>
<script src="js/app/upstreams/upstream.js?r=0.14.6"></script>
<script src="js/app/upstreams/upstreams-controller.js?r=0.14.6"></script>
<script src="js/app/upstreams/upstreams-service.js?r=0.14.6"></script>
<script src="js/app/users/00_users.js?r=0.14.6"></script>
<script src="js/app/users/user-controller.js?r=0.14.6"></script>
<script src="js/app/users/user-create-controller.js?r=0.14.6"></script>
<script src="js/app/users/user-model.js?r=0.14.6"></script>
<script src="js/app/users/users-controller.js?r=0.14.6"></script>
<!--SCRIPTS END-->

<% }%>

<script>
  window.angularDebugEnabled = <%= angularDebugEnabled %>;


  // Disable console logs in production
  if (!window.angularDebugEnabled && window['console']) {
    window['console']['log'] = function () {
    };
  }

  if(window.initAngular) {
    angular.element(document).ready(function () {

      var initInjector = angular.injector(["ng"]);
      var $http = initInjector.get("$http");

      // Load initial configuration to window
      $http.get('api/settings')
        .then(function (response) {
          window.KONGA_CONFIG = response.data.data
          window.KONGA_CONFIG_ID = response.data.id
          angular.bootstrap(document, ['frontend']);
        })
        .catch(function (err) {
          alert("Error getting initial configuration")
        })


    });
  }


</script>

</body>
</html>
